home *** CD-ROM | disk | FTP | other *** search
/ Experimental BBS Explossion 3 / Experimental BBS Explossion III.iso / gus / gusdly03.zip / GUSDELAY.TXT
Text File  |  1993-09-17  |  18KB  |  318 lines

  1. This is the documentation file for GUSDELAY.EXE version 0.3.
  2. Copyright (c) 1993 by David MacMahon - All rights reserved
  3.  
  4. This program, GUSDELAY.EXE, may be freely distributed provided that this 
  5. documentation accompanies the program, no fee is charged for the program
  6. (except for a NOMINAL media charge), and it is not distributed as part of
  7. any commercial offering.
  8.  
  9. Versions 0.x are pre-release versions and are considered "freeware" (subject 
  10. to the terms in the preceding paragraph).  No fee is required for using the
  11. pre-release versions of the program.  Version 1.0 and all subsequent versions
  12. will be "shareware" (or some variation of the shareware theme).
  13.  
  14. TABLE OF CONTENTS
  15. 0. NEW FEATURES AND CHANGES
  16. 1. HOW TO USE GUSDELAY
  17.    a) Overview
  18.    b) Adding, deleting, and selecting voices
  19.    c) Changing the volume of a voice
  20.    d) Changing the delay of a voice
  21.    e) Changing the pan position (balance) of a voice
  22.    f) Saving to disk
  23.    g) Quitting GUSDELAY
  24. 2. CONTACTING THE AUTHOR
  25. 3. THINGS TO DO / CURRENT LIMITATIONS
  26. 4. INTERESTING TECH NOTES (Look here if you have problems!)
  27.  
  28. 0. NEW FEATURES AND CHANGES
  29. I have fixed the bug that caused noise in the right channel.  I have added
  30. support for more than one voice.  It is now possible to adjust a voice's
  31. volume on-the-fly.  It is now possible to adjust the pan position (balance)
  32. of a voice on-the-fly.  In stereo, this controls the separation of the
  33. voices.  In mono, this controls the regeneration (echo) of the delayed
  34. signal.  (Using this technique, if you put mono in on the left channel of the
  35. input connector and take mono out from the right channel of the output
  36. connector, GUSDELAY turns your GUS into an ideal delay unit for musical
  37. instruments!)  I have changed the interface to accommodate all of the new
  38. functionality.  I have changed the delay to be in terms of samples instead
  39. of "download buffers".  A "download buffer" is 32 or 64 samples.  Which size
  40. it is depends on the sampling frequency.  If 32 samples (per channel) are
  41. taken in less than 1 ms then the download buffer will be 64 samples.  This
  42. means that the minimum delay is now one "download buffer" plus one sample.
  43. The minimum delay used to be two "download buffers".
  44.  
  45. 1. HOW TO USE GUSDELAY
  46. a) Overview
  47. The program accepts no command line arguments, so just type GUSDELAY to
  48. start it.  The program firsts asks if you want to record in stereo or mono.
  49. Then it will ask you for a sampling frequency.  If you enter a sampling
  50. frequency that is not one of the 256 discrete sampling frequencies at which
  51. the GUS can sample, GUSDELAY will print the actual sampling frequency that 
  52. is used.  This will be a little higher than the frequency you specified.
  53. On my 25 MHz 386 I have been able to use 11025 (Hz) without losing any
  54. samples (that I can detect).  I would be fascinated to find out how it works
  55. on other types of machines.  GUSDELAY then asks you which input source to
  56. use (Line In, Mic In, or both).  Then it starts delaying.  While it is 
  57. delaying, there are several keys that you can use to change various 
  58. parameters (i.e. volume, delay, panning), add and delete voices, and turn
  59. disk writing on and off.  These keys and their effects are discussed below.
  60.  
  61. b) Adding, deleting, and selecting voices
  62. When GUSDELAY first starts delaying, there are no "active voices".  An
  63. active voice is a voice that is playing back delayed data.  This version of
  64. GUSDELAY supports up to 14 active voices.  In stereo, voices are used in
  65. pairs so you can have up to 7 pairs of active voices.  Since the each voice
  66. has several parameters that can be independently configured, one of the
  67. active voices is considered the "current voice".  The current voice is the
  68. active voice whose parameters can be changed.  In stereo, there are two
  69. current voices; one for the left channel and one for the right channel.
  70. Any active voice can be the current voice.  Active voices can be made
  71. inactive.  Here are the keystrokes for adding/deleting active voices and
  72. selecting the current voice.
  73.  
  74.       Insert - Activates that first inactive voice and makes it the current
  75.                voice.
  76.       Delete - De-activates the last activated voice.  If this voice happens
  77.                to be the current voice, then the next-to-last activated voice
  78.                will become the new current voice.
  79.      Page Up - Cycles the current voice through all active voices in
  80.                ascending order.
  81.    Page Down - Cycles the current voice through all active voices in
  82.                descending order.
  83.  
  84. c) Changing the volume of a voice
  85. The volume of a voice can range from 0 to 4095.  This is NOT a linear scale.
  86. You will have to play around the volume to get a feel for it.  In stereo,
  87. setting the volume too high (basically anything above 3600 with one active
  88. voice) will cause a positive feedback effect and it will sound like
  89. (surprise!) feedback.  Adjusting the volume to just below this threshold
  90. causes some interesting effects.  This threshold value gets lower and lower
  91. as active voices are added.  In stereo, adjusting a voice's volume is the
  92. only way to control the regenerative (echo) properties of that voice.  In
  93. mono, the regenerative properties of a voice and the positive feedback
  94. threshold are dependent on the pan position of the voice (see below) as well
  95. as its volume.  Here are the keystrokes for changing the volume of the
  96. current voice.
  97.  
  98.           Up Arrow - Increases the volume of the current voice by 10
  99.         Down Arrow - Decreases the volume of the current voice by 10
  100.      Ctrl Up Arrow - Increases the volume of the current voice by 100
  101.    Ctrl Down Arrow - Decreases the volume of the current voice by 100
  102.  
  103. d) Changing the delay of a voice
  104. The delay of a voice can range from a minimum of 1 sample (actually 1 sample
  105. plus one download buffer) to a maximum of approximately 256K samples for
  106. mono and 128K samples for stereo.  GUSDELAY does not use more than 256K of
  107. the GUS' DRAM (yet).  Here are the keystrokes for changing the volume of the
  108. current voice.
  109.  
  110.                 '+' - Increases the delay of the current voice by 10
  111.                 '-' - Decreases the delay of the current voice by 10
  112.                 '*' - Increases the delay of the current voice by 100
  113.                 '/' - Decreases the delay of the current voice by 100
  114.         Right Arrow - Increases the delay of the current voice by 50
  115.          Left Arrow - Decreases the delay of the current voice by 50
  116.    Ctrl Right Arrow - Increases the delay of the current voice by 500
  117.     Ctrl Left Arrow - Decreases the delay of the current voice by 500
  118.             '0'-'9' - Sets the last digit of the current voice's delay
  119.  
  120. e) Changing the pan position (balance) of a voice
  121. The pan position of a voice can range from 0 to 15 with 0 being all the way
  122. to the left, 15 being all the way to the right, and 7 being centered.  In
  123. stereo, the left voice starts with a pan position of 0 and the right voice
  124. starts with a pan position of 15.  Changing the pan position of the current
  125. (stereo) voice pair will affect the separation.  After 7 changes away from
  126. the initial pan positions, both voices will be just about dead center (no
  127. separation).  After 15 changes away from the initial pan positions, the left
  128. voice will be all the way to the right and the right voice will be all the
  129. way to the left.  In mono, all voices start with a pan position of 15 (far
  130. right).  Since, in mono,  the GUS samples only the left channel, the output
  131. of voices with this pan position will not regenerate (echo) at all (i.e. the
  132. voice's delayed data will be heard only once).  Changing the pan position of
  133. the current (mono) voice will also change the amount of that voice's
  134. regeneration (echo).  As mentioned above, this technique can turn your GUS
  135. into an ideal delay unit for musical instruments.  Here are the keystrokes
  136. for changing the pan position of the current voice.
  137.  
  138.    '>' - Increases the value of the pan position of the current voice by 1.
  139.          In stereo, this increases (by 1) the pan position of the left voice
  140.          of the current voice pair and decreases (by 1) the pan position of
  141.          the right voice.  This has the effect of decreasing the separation
  142.          (unless the voices have "crossed", in which case the separation is
  143.          increased.)  In mono, this decreases the regeneration of the current
  144.          voice.
  145.    '<' - Decreases the value of the pan position of the current voice by 1.
  146.          In stereo, this decreases (by 1) the pan position of the left voice
  147.          of the current voice pair and increases (by 1) the pan position of
  148.          the right voice.  This has the effect of increasing the separation
  149.          (unless the voices have "crossed", in which case the separation is
  150.          decreased.)  In mono, this increases the regeneration of the current
  151.          voice.
  152.    
  153. f) Saving to disk
  154. When the program starts, disk writing is turned off.  Turning on disk
  155. writing on causes a file named DATAFILE.SB to be created (or overwritten) in
  156. the current directory.  Turning disk writing off acts like 'Pause'.  No data
  157. are written until disk writing is toggled back on.  Data written after disk
  158. writing is toggled back on are appended to the data already written to
  159. DATAFILE.SB.  This file contains only raw data samples.  It is identical in
  160. format to USS8's .SND files in that there is no header information, but
  161. DATAFILE.SB contains *signed* data (USS8's .SND files contain *unsigned*
  162. data).  I chose the .SB extension to facilitate processing this file with SOX
  163. (an excellent utility, BTW).  SB stands for "Signed Bytes", and is an
  164. extension understood by SOX to imply just that.  It does not stand for "Sound
  165. Board" and *definitely* not "Sound B*****r" :-)  To create a .WAV file from
  166. DATAFILE.SB file, use this command:
  167.  
  168. sox -r <sample_rate> -c <#_of_channels> datafile.sb <yourname>.wav
  169.  
  170. Here are the keystrokes for toggling disk writing on and off.
  171.  
  172.    'd' or 'D' - Toggles disk writing on and off
  173.  
  174. g) Quitting GUSDELAY
  175. Here are the keystrokes for quitting GUSDELAY.
  176.  
  177.    'q' or 'Q' - Quits GUSDELAY
  178.  
  179. 2. CONTACTING THE AUTHOR
  180. I can be reached via e-mail at davidm@marcam.com.  I am very interested in
  181. your feedback, both good and bad, and will try to respond to all of it.  I
  182. also read the "GUS SDK Digest", the "Ultrasound Daily Digest" and the news
  183. group comp.sys.ibm.pc.soundcard.
  184.  
  185. 3. THINGS TO DO / CURRENT LIMITATIONS
  186. Even though the current version of GUSDELAY has quite a bit of functionality,
  187. there are more features I would like to add.  Some of these offer new
  188. functionality while others offer increased ease of use.  The functionality
  189. in the current version is close to what the shareware and crippleware
  190. versions will offer.  I plan on releasing versions 1.x as shareware.  These
  191. versions will have the same not-so-hot user interface as the current version
  192. as well as some new functionality (see below).  Versions 2.x will be released
  193. as crippleware (i.e. after a few minutes the program introduces noice into
  194. the output).  These versions will sport a new graphical user interface (most
  195. likely TurboVision) and offer many features that will make GUSDELAY *much*
  196. easier and convenient to use.  All registered users of any 1.x version will
  197. automatically become registered users of all 2.x versions that are released.
  198. Below are the feature lists for versions 1.0 and 2.0.  There is also a list
  199. of planned features that will be put into a 1.x version or a 2.x version.
  200.  
  201. Feature list for version 1.0
  202. ----------------------------
  203.  - All the functionality of version 0.3.
  204.  - Command line arguments to specify mono/stereo, sample rate, and input.
  205.  - "Negative volume" - Essentially, this will allow voices to play back
  206.    the original signal or its inverse.  This will allow the GUS to act as a
  207.    recursive or non-recirsive digital filter.  As of version 0.3, GUSDELAY
  208.    supported multiple voices, so recursive or non-recursive digital filters
  209.    could be implemented, but without the "negative volume" feature, all of
  210.    the filter's coefficients had to be positive.
  211.  
  212. Feature list for version 2.0
  213. ----------------------------
  214.  - All the functionality of version 1.x.
  215.  - Graphical user interface (probably TurboVision).
  216.  - Write to user-specified filenames instead of DATAFILE.SB.
  217.  - Create .WAV files instead of raw data files.
  218.  - Save and load configuration files for presetting voices.
  219.  
  220. Features for versions 1.x or 2.x
  221. --------------------------------
  222.  - Support for more than 256K of GUS DRAM
  223.  - Flanger effect - This will fluctuate a voice's playback frequency above
  224.    and below the recording frequency.
  225.  - Tremelo effect - This will fluctuate a voice's volume.
  226.  - Adjustable maximum delay.
  227.  - Ability to change loop mode - Allow voices to loop bi-directionaly.  This,
  228.    in combination with the adjustable maximum delay, can create some bizarre 
  229.    effects.
  230.  - Compensation mode - This is strictly conceptual at this point, but I
  231.    envision a mode of operation that will produce sample sounds and measure
  232.    the regeneration effects at different volumes and pan positions.  This
  233.    information, in conjuction with negative volume, will be used to
  234.    facilitate multiple echo elimination.
  235.  - Your excellent idea here - I am always willing to consider new ideas
  236.  
  237. 4. INTERESTING TECH NOTES
  238. (A) You MUST use different DMA channels for recording and playback.  This is 
  239. obvious, but I felt I should state the obvious.  I have the recording DMA on 
  240. a lower (16-bit) DMA channel (higher priority) than the playback (16-bit) 
  241. DMA, but I haven't played around with it to see if that really matters.
  242.  
  243. (B) Do NOT use EMM386.EXE.  I had this in my configuration and everything 
  244. worked fine (SBOS, Mega-Em, AIL, native demos, etc.), but when I use EMM386 
  245. with my program, the sound is horrendous.  I think it is missing samples 
  246. because the DMA requests are being virtualized (i.e. slowed down).  Since I 
  247. don't have 386Max or QEMM, I couldn't try those.
  248.  
  249. (C) I tried using two different schemes to get the continuous 
  250. recording/playback to work.  Both involved double-buffering.  Theoretically, 
  251. both should work, but after I got one to work, I did not try to get the 
  252. other one to work (because no one has answered my question about auto-init 
  253. DMA :-( ).  Scheme 1 (which I did get to work) uses the Record Handler (no 
  254. auto-init) at the end of each buffer to control the downloading of data to 
  255. the GUS and ping-ponging of the buffers. Scheme 2 (which I did not get to 
  256. work) uses a Timer Handler to download the first half of the buffer
  257. (buffer A) and the Record Handler (with auto-init) to download the second
  258. half of the buffer (buffer B).  On my 25MHz 386DX, I am able to use a 
  259. sample rate of 11025 Hz without losing any samples (that I can detect).
  260. The only other rates I have tried are 22050 Hz and 44100 Hz, but I lose 
  261. samples at both of those rates.
  262.  
  263. (D) The playback rate and record rate are not always identical even if you 
  264. ask for them to be identical.  This one really threw me for a while.  If I 
  265. set it up for a noticeable delay time (1 sec), it would start out fine, but 
  266. then the voice would creep up (IOW, the delay would shrink) and pass the 
  267. point where I was writing new data into the GUS' memory.  I solved this by 
  268. putting an UltraSetVoice call in the Record Handler to "correct" the 
  269. position of the voice on every Record Handler call.  I know this "voice 
  270. creep" happens at 11025 Hz which is one of the 256 discrete frequencies at 
  271. which the GUS can sample.
  272.  
  273. (E1) This one bothers me because it seems to be a hardware limitation of the 
  274. analog portion of the GUS itself.  In "Advanced Gravis Tech Note #20" which 
  275. John Smith submitted to "Ultrasound Daily Digest V5 #18", it says...
  276.  
  277. >There is NO way to disable the Mic/Line in from being passed to the
  278. >line out. Hence, you can record and playback at the same time but keep
  279. >in mine [sic] what you are trying to record and what you are trying to
  280. >play through the UltraSound will be mixed by the time it is outputed [sic].
  281.  
  282. This is true, however, my experiences with my program indicate that the 
  283. output is also mixed in with the input!!!  My program is set up to play the 
  284. delayed data once and only once, but the volume of the voice that is playing 
  285. the delayed data affects how many times the data is "echoed".  If you set 
  286. the volume too high, you end up with a positive feedback situation where the 
  287. data gets repeated at louder and louder levels until it breaks up into 
  288. oblivion.  This has (at least) two bad ramifications.  The first is that the 
  289. idea mentioned in "Advanced Gravis Tech Note #20" (i.e. writing "a recording 
  290. studio program which would record to disk and while it is recording have the 
  291. UltraSound verbally tell the user how much disk space they have left.") 
  292. would work, but the time remaining announcement would be recorded along with 
  293. the real data that you want to record.  The second is that if you want to 
  294. use several different delays of the same data to create a unique reverb 
  295. effect, you are going to get multiples of each delay summed in as well which 
  296. is probably not desirable.  Speaking of this technique, it's too bad that 
  297. you can't have "negative" volume that would play an inverse of the data.
  298.  
  299. (E2) Thanks to Tom Klok for an excellent idea.  Here is a quote from him:
  300. >Ok, this problem seems insurmountable -- for stereo!  But what if we try it
  301. >in mono instead?
  302. >
  303. >Hook your source up to the left channel of the GUS's input.  The right
  304. >channel should be supplied silence.  As clean a silence as you can manage,
  305. >since any noise here will be mixed into the output.
  306. >
  307. >Now start recording in mono.  The GUS will sample only the left channel, but
  308. >feed the raw input from both channels to the outputs.  You'll hear clean on
  309. >the left, silence on the right.
  310. >
  311. >Now do your processing (ie block copy to GUS DRAM) and start playback, but
  312. >play in mono mode with the voice's pan position hard over to the right
  313. >channel.  You end up with just the unprocessed source on the left, and just
  314. >the processed on the right.  Listen to the channel you like (probably right).
  315.  
  316. Enjoy!
  317. Dave
  318.